package com.oauth.components.client.ui.windows;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DecoratedStackPanel;
import com.google.gwt.user.client.ui.Label;

public class JoinMemberWindow extends Composite {

	private static JoinMemberWindowUiBinder uiBinder = GWT.create(JoinMemberWindowUiBinder.class);

	interface JoinMemberWindowUiBinder extends UiBinder<DecoratedStackPanel, JoinMemberWindow> {
	}

	@UiField
	Label googlePanel;

	@UiField
	DecoratedStackPanel stackPanel;

	public JoinMemberWindow() {
		initWidget(uiBinder.createAndBindUi(this));
		stackPanel.setStackText(0, "<div class=\"stackText\">Join this site</div>", true);
		googlePanel.getElement().setInnerHTML(getHardHTML());
	}

	public String getHardHTML() {
		return "<!-- Include the Google Friend Connect javascript library. -->"
				+ "<script type=\"text/javascript\" src=\"http://www.google.com/friendconnect/script/friendconnect.js\"></script>"
				+ "<!-- Define the div tag where the gadget will be inserted. -->"
				+ "<div id=\"div-2906730523221652775\" style=\"width:276px;border:1px solid #cccccc;\"></div>"
				+ "<!-- Render the gadget into a div. -->"
				+ "<script type=\"text/javascript\">"
				+ "var skin = {};"
				+ "skin['BORDER_COLOR'] = '#cccccc';"
				+ "skin['ENDCAP_BG_COLOR'] = '#e0ecff';"
				+ "skin['ENDCAP_TEXT_COLOR'] = '#333333';"
				+ "skin['ENDCAP_LINK_COLOR'] = '#0000cc';"
				+ "skin['ALTERNATE_BG_COLOR'] = '#ffffff';"
				+ "skin['CONTENT_BG_COLOR'] = '#ffffff';"
				+ "skin['CONTENT_LINK_COLOR'] = '#0000cc';"
				+ "skin['CONTENT_TEXT_COLOR'] = '#333333';"
				+ "skin['CONTENT_SECONDARY_LINK_COLOR'] = '#7777cc';"
				+ "skin['CONTENT_SECONDARY_TEXT_COLOR'] = '#666666';"
				+ "skin['CONTENT_HEADLINE_COLOR'] = '#333333';"
				+ "skin['NUMBER_ROWS'] = '4';"
				+ "google.friendconnect.container.setParentUrl('/' /* location of rpc_relay.html and canvas.html */);"
				+ "google.friendconnect.container.renderMembersGadget("
				+ "{ id: 'div-2906730523221652775',site: '06416753525805380752' },skin);"
				+ "</script>";
	}

}
